Skip to content

feat(core): add ManifestStore.fromBundle for bundled artifacts#5876

Merged
killagu merged 2 commits into
split/01-utils-bundle-module-loaderfrom
split/05-core-from-bundle
Apr 25, 2026
Merged

feat(core): add ManifestStore.fromBundle for bundled artifacts#5876
killagu merged 2 commits into
split/01-utils-bundle-module-loaderfrom
split/05-core-from-bundle

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented Apr 21, 2026

Adds static ManifestStore.fromBundle(data, baseDir) that creates a store from pre-validated bundled manifest data, skipping lockfile/config fingerprint checks.

Part of #5863 split. Tracking: #5871. Stacked on: #5867 (A1)

🤖 Generated with Claude Code

Add `ManifestStore.fromBundle(data, baseDir)` that creates a store from
pre-validated bundled manifest data, skipping the lockfile / config
fingerprint checks that would fail for a frozen artifact shipped across
environments. Only the manifest `version` field is validated — the caller
(bundler) is responsible for guaranteeing the data matches the artifact.

Required by the upcoming @eggjs/egg-bundler to bootstrap a bundled Egg
app without re-running filesystem discovery.
Copilot AI review requested due to automatic review settings April 21, 2026 15:19
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 64b26f04-59a3-48c3-97a7-e269ab2ec538

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch split/05-core-from-bundle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fromBundle static method to the ManifestStore class, allowing the creation of a store from pre-validated bundled data while skipping standard invalidation checks. The review feedback suggests improving the robustness of this new method by adding null checks for the input data, verifying the presence of required properties like invalidation, and including a debug log for better observability.

Comment thread packages/core/src/loader/manifest.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new public factory API on @eggjs/core’s ManifestStore to support bundled runtime artifacts by constructing a store from pre-validated manifest data and bypassing the normal invalidation checks.

Changes:

  • Add ManifestStore.fromBundle(data, baseDir) for bundled startup paths
  • Validate bundled manifest version before constructing the store

Comment thread packages/core/src/loader/manifest.ts
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 25, 2026

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 60804b3
Status: ✅  Deploy successful!
Preview URL: https://04a1b50d.egg-v3.pages.dev
Branch Preview URL: https://split-05-core-from-bundle.egg-v3.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 60804b3
Status: ✅  Deploy successful!
Preview URL: https://fcab2648.egg-cci.pages.dev
Branch Preview URL: https://split-05-core-from-bundle.egg-cci.pages.dev

View logs

@killagu killagu merged commit 44099b8 into split/01-utils-bundle-module-loader Apr 25, 2026
7 checks passed
@killagu killagu deleted the split/05-core-from-bundle branch April 25, 2026 13:41
killagu added a commit that referenced this pull request May 1, 2026
Adds static `ManifestStore.fromBundle(data, baseDir)` that creates a
store from pre-validated bundled manifest data, skipping lockfile/config
fingerprint checks.

Part of #5863 split. Tracking: #5871. Stacked on: #5867 (A1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
killagu added a commit that referenced this pull request May 2, 2026
## Summary

Source branch: origin/split/01-utils-bundle-module-loader
Base: origin/next @ 101ab97

Patch-equivalence checks showed several source commits had equivalent
counterparts already on next, but review-fix deltas were still missing
or had evolved under different SHAs. This PR ports the equivalent patch
set onto latest next without merging the old split branch history.

Ported source commits / equivalent patches:
- a4430eb feat(core): add ManifestStore.fromBundle for bundled
artifacts (#5876)
- 141d261 feat(core): add ManifestStore.setBundleStore hook (#5877)
- 4cb2192 fix(bundler): address externals resolver review
- af022dc fix(bundler): bundle framework packages by default
- c26d172 fix(bundler): harden manifest loader normalization
- 963fa03 fix(bundler): disable manifest auto generation default
- 6f7b8f5 fix(core): restore global bundle store typing
- 0d816c2 fix(bundler): address manifest loader review
- ff1eba3 fix(bundler): address manifest subprocess review
- ebb103d fix(bundler): emit only worker entry in single mode

Already covered on next by equivalent/evolved commits and not re-applied
directly:
- 3e8b6c8 feat(bundler): add ExternalsResolver
- f47dedc feat(bundler): add ManifestLoader with realpath normalization
- 36bf376 fix(bundler): address entry generator review
- scaffold/public API/PackRunner commits that would regress newer
Bundler and egg-bin changes if replayed wholesale

## Validation

- pnpm vitest run packages/core/test/loader/manifest.test.ts
- pnpm --filter @eggjs/egg-bundler test -- test/EntryGenerator.test.ts
test/ExternalsResolver.test.ts test/ManifestLoader.test.ts
test/integration.test.ts
- pnpm --filter @eggjs/core typecheck
- pnpm --filter @eggjs/egg-bundler typecheck
- pnpm --filter @eggjs/egg-bundler lint

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Package exports now declare types and import targets for better
TypeScript support
  * Manifest auto-generation is opt-in by default

* **New Features**
* Bundler now emits a single worker entry (no standalone agent entry by
default)

* **Bug Fixes**
  * Stronger validation and clearer errors for bundled manifests
  * Bundle usage respects base-directory and environment isolation
* Optional dependencies are considered for externalization; framework
packages are bundled by default

* **Tests**
* Expanded coverage for manifest loading, bundling, externals, and
generation flows
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants